<style>
	.taleleftcol
	{
		font-size: 14px;
		font-weight: 600;
		padding-top: 2px;
		background-color:#DDDDDD;
	}
	.taletoprow
	{
		font-size: 14px;
		font-weight: 600;
		text-align:center;
		padding-top: 2px;
		background-color:#DDDDDD;
	}
	.table
	{
		border-right:1px solid #BBFFEE;
	}
	.table td
	{
		border-left:1px solid #BBFFEE;
		text-align:center;
	}
	.table input
	{
		width:30px;
	}
</style>

<script language="javascript">
		function getTabledata(pre, row, col)
		{
			rstr = "";
			for(var i = 1; i <= row; i ++)
			{
				stri = "";
				for(var j = 1; j <= col; j ++)
				{
					tojbid = pre + "_" + i + "_" + j;
					tobj = document.getElementById(tojbid);
					if(tobj)
					{
						strorg = tobj.value;
						if(strorg == "")
						{
							strorg = " ";
						}
						strorg = strorg.replace(/\|\;\|/g, "");
						strorg = strorg.replace(/\|\:\|/g, "");
						stri += strorg;
						if(col != j)
						{
							stri += "|:|";
						}
					}
					//alert(stri);
				}
				if(row == i)
				{
					rstr += stri;
				}
				else
				{
					rstr += stri + "|;|";
				}
			}
			return rstr;
		}
		function getSelectGame()
		{
			var rgames = [];
			games = ["天龙八部", "传奇", "征途","征途2", "仙侠世界", "梦幻西游","魔兽世界", "大话西游", "完美世界", "诛仙", "其他"];
			for(var i = 1; i <= 11; i ++)
			{
				var tempojbs = document.getElementsByName("element_3_" + i);
				if(tempojbs.length > 0)
				{
					if(tempojbs[0].checked)
					{
						rgames.push(games[i-1]);
					}
				}
			}

			return rgames;
		}
		function writeTable(rowarr, colarr, tableid)
		{
			var rnum = rowarr.length;
			var cnum = colarr.length;
			var wstr = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" class=\"talbe\">";
			for(var i = 0; i <= rnum; i ++)
			{
				wstr += "<tr>";
				for(var j = 0; j <= cnum; j ++)
				{
					if(j == 0 && i == 0)
					{
						wstr += "<td class=\"taletoprow\">&nbsp;</td>";
					}
					else if(j == 0 && i > 0)
					{
						wstr += "<td class=\"taleleftcol\">" + rowarr[i - 1] + "</td>";
					}
					else if(i == 0 && j > 0)
					{
						wstr += "<td class=\"taletoprow\">" + colarr[j - 1] + "</td>";
					}
					else
					{
						wstr += "<td><input width=\"50\" id=\"" + tableid + "_" + i + "_" + j + "\" type=\"text\"></input></td>";
					}
				}
				wstr += "</tr>";
			}
			wstr += "</table>";
			return wstr;
		}
		function writeTableWithSelect(rowarr, colarr, tableid, optarr)
		{
			
			
			var rnum = rowarr.length;
			var cnum = colarr.length;
			var wstr = "<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" class=\"talbe\">";
			for(var i = 0; i <= rnum; i ++)
			{
				wstr += "<tr>";
				for(var j = 0; j <= cnum; j ++)
				{
					if(j == 0 && i == 0)
					{
						wstr += "<td class=\"taletoprow\">&nbsp;</td>";
					}
					else if(j == 0 && i > 0)
					{
						wstr += "<td class=\"taleleftcol\">" + rowarr[i - 1] + "</td>";
					}
					else if(i == 0 && j > 0)
					{
						wstr += "<td class=\"taletoprow\">" + colarr[j - 1] + "</td>";
					}
					else
					{
						var optstr = "";
						for(var k = 0; k < optarr.length; k ++)
						{
							if(i == k)
							{
								optstr += "<option selected='true' value=\"" + optarr[k] + "\" >" + optarr[k] +"</option>";
							}
							else
							{
								optstr += "<option value=\"" + optarr[k] + "\" >" + optarr[k] +"</option>";
							}
						}
						wstr += "<td><select id=\"" + tableid + "_" + i + "_" + j + "\" type=\"text\">" + optstr + "</select></td>";
					}
				}
				wstr += "</tr>";
			}
			wstr += "</table>";
			return wstr;
		}
		
		function ongameBoxClick()
		{
			var ga = getSelectGame();
			table32col = ga;
			table32 = writeTableWithSelect(table32row, table32col, "table32", optarr32);
			document.getElementById("table32c").innerHTML = table32;
			
			table25row = ga;
			table25 = writeTableWithSelect(table25row, table25col, "table25", optarr21);
			document.getElementById("table25c").innerHTML = table25;

			table26row = ga;
			table26 = writeTableWithSelect(table26row, table26col, "table26", optarr21);
			document.getElementById("table26c").innerHTML = table26;

			table27col = ga;
			table27 = writeTableWithSelect(table27row, table27col, "table27", optarr27);
			document.getElementById("table27c").innerHTML = table27;

			table34row = ga;
			table34 = writeTableWithSelect(table34row, table34col, "table34", optarr34);
			document.getElementById("table34c").innerHTML = table34;
		}

		function onExitClick(tar)
		{
			if(tar && tar.checked)
			{
				//alert("您未满足调查条件，将退出调查！");
				alert("您未满足调查条件，将退出调查！");
				window.opener=null;
				window.open('','_self');
				window.close();
			}
		}

		function checknum(tar, min, max)
		{
			tar.value = tar.value.replace(/[^0-9]+/,'');
			if(tar.value > max || tar.value < min)
			{
				tar.value = "";
				alert("请输入" + min + "至" + max + "之前的数字");
			}
		}
</script>